<?php
include_once('config.php');


include_once( CORE_PATH . "/SellerAuth.php" );
$Auth = new SellerAuth();


//dump($_SESSION);
/*
 * --------------------------------------------------------------------
 * 载入 页面 ,子控制器 和 方法
 * --------------------------------------------------------------------
 *
 */
$page = (empty($_REQUEST['p']) && empty($_REQUEST['c']))? "admin" : strtolower($_REQUEST['p']);
$class = !empty($_REQUEST['c'])? strtolower($_REQUEST['c']) : '';
$method = !empty($_REQUEST['m'])? strtolower($_REQUEST['m']) : '';


if($page == 'index'){
    show_front_page($page);
}

if($page == 'admin'){
    if(!$_SESSION['tb_uid']){
        echo '<p style="text-align:center;font-size:24px;padding-top: 20px;">亲,授权失败!</p>
        <p style="text-align:center;font-size:20px;padding-top: 20px;"><a href="'.LIMIT_AUTH_URL.'" target="_blank">请<strong>【点击这里】</strong>在新页面继续操作.<a/></p>';
    }else{
         show_admin_page('index');
    }
}


if (file_exists(CTRLS_PATH.'/'.$class.'.php')) {
    include_once(CTRLS_PATH.'/'.$class.'.php');

    unset($TATA);
    $TATA = new $class();

    //执行方法
    if (method_exists($TATA, $method)) {
        $TATA->$method();
    } else {
        $TATA->index();
    }
}



